<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('车牌进出场信息列表')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>车牌：</label>
                                <input type="text" name="inNo"/>
                            </li>
                            <li>
                                <label>用户信息：</label>
                                <input type="text" name="userInfo"/>
                            </li>
                            <li>
                                <label>入场时间：</label>
                                <input type="text" class="time-input" placeholder="请选择入场时间" name="inTime"/>
                            </li>
                            <li>
                                <label>出场时间：</label>
                                <input type="text" class="time-input" placeholder="请选择出场时间" name="outTime"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="form-group">
                <label class="font-noraml" style="margin: 5px;">车辆进出场信息上传</label>
                <div class="file-loading">
                    <input id="singleFile" name="file" type="file">
                </div>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: bootstrap-fileinput-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:tzCarIoLog:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:tzCarIoLog:remove')}]];
        var prefix = ctx + "system/tzCarIoLog";
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "车牌进出场信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'noType',
                    title: '车牌类型'
                },
                {
                    field: 'carType',
                    title: '车辆类型'
                },
                {
                    field: 'inNo',
                    title: '入场车牌'
                },
                {
                    field: 'outNo',
                    title: '出场车牌'
                },
                {
                    field: 'outType',
                    title: '出厂类型'
                },
                {
                    field: 'userInfo',
                    title: '用户信息'
                },
                {
                    field: 'inTime',
                    title: '入场时间'
                },
                {
                    field: 'outTime',
                    title: '出场时间'
                },
                {
                    field: 'singleTimeStr',
                    title: '单次累计时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        //actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        //actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);

            // 单图上传
            $("#singleFile").fileinput({
                uploadUrl: prefix + '/upload',
                maxFileCount: 1,
                autoReplace: true,
                showPreview: false
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                log.info("return url：" + rsp)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
        });
    </script>
</body>
</html>